package com.servlet;

import com.ccptc.oyvshop.Dao.UserDao;
import com.zzpyc.oyvshop.vo.Users;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

public class Servlet extends javax.servlet.http.HttpServlet {
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

        doGet(request,response);
    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
PrintWriter pw=response.getWriter();
pw.print("666");
String username= request.getParameter("userName");
String pwd= request.getParameter("password");
pw.print(username+",hello");
        UserDao userDao=new UserDao();//?
        Users user=new Users();
        user.setEu_user_id("6");
        user.setEu_user_name(username);
        user.setEu_password(pwd);
        boolean b=false;
        b = userDao.insert(user);
        if(b) {
           System.out.println("succ");
       }else{
           System.out.println("error");
       }
       }
    }

